package com.yuncheng.spcyApi.bo;

import java.util.Objects;

public class Cell {

    /**
     * 行
     */
    private int row;
    /**
     * 列
     */
    private int column;
    /**
     * x 坐标
     */
    private int x;
    /**
     * y 坐标
     */
    private int y;
    /**
     * 当前单元格的父级单元格所在的列
     */
    private int belongColumn;
    /**
     * 单元格宽度,对于有从属单元格的，其宽度由从属单元格决定
     */
    private int width;
    /**
     * 、
     * 合并单元格的情况会用到，默认为行高
     */
    private int height;
    /**
     * 单元格内容
     */
    private String content;
    /**
     * 是否水平居中
     */
    private boolean textAlign;

    public int getRow() {
        return row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getColumn() {
        return column;
    }

    public void setColumn(int column) {
        this.column = column;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getBelongColumn() {
        return belongColumn;
    }

    public void setBelongColumn(int belongColumn) {
        this.belongColumn = belongColumn;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isTextAlign() {
        return textAlign;
    }

    public void setTextAlign(boolean textAlign) {
        this.textAlign = textAlign;
    }

    public Cell(int row, int column, int width, int belongColumn) {
        this.row = row;
        this.column = column;
        this.width = width;
        this.belongColumn = belongColumn;
    }

    public Cell() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Cell cell = (Cell) o;
        return row == cell.row && column == cell.column;
    }

    @Override
    public int hashCode() {
        return Objects.hash(row, column);
    }

}
